package com.sunriz.refreshhcdata.controller;

import com.sunriz.refreshhcdata.POJO.InfoWriteDTO;
import com.sunriz.refreshhcdata.POJO.Result;
import com.sunriz.refreshhcdata.server.SendDataServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: SendDataController
 * Package: com.sunriz.refreshhcdata.controller
 * Description:
 *
 * @Author BuTang
 * @Create 2024/10/15 15:42
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/send")
public class SendDataController {

    @Autowired
    SendDataServer sendDataServer;


    /**
     * 获取 mc 下发数据接口
     *
     * @return address  - hc 的寄存器地址;
     *         infoName - 对应 address 的寄存器名称;
     *         value    - 寄存器的值;
     */
    @GetMapping("/getSendValue")
    public Result getSendValue(){
        List<InfoWriteDTO> sendValue = sendDataServer.getSendValue();
        return Result.success(sendValue);
    }



}
